package com.glory.hzlionpda.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.glory.hzlionpda.R;
import com.glory.hzlionpda.bean.WaferBean;
import com.glory.hzlionpda.bean.WaferLotBean;

import java.util.List;


public class LotThingListAdapter extends BaseQuickAdapter<WaferLotBean, BaseViewHolder> {

    public LotThingListAdapter(@Nullable List<WaferLotBean> data) {
        super(R.layout.adapter_lot_thing_list, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, final WaferLotBean item) {
        helper.setText(R.id.tvLotID, item.getLOTID());
        StringBuffer sb = new StringBuffer();
        int i = 1;
        for (WaferBean waferBean : item.getWAFER()) {
            sb.append(waferBean.getWAFERID());
            if (i % 2 == 0) {
                sb.append("\n");
            } else {
                sb.append("，");
            }
            i++;
        }
        helper.setText(R.id.tvWafer, sb.toString());
    }
}
